﻿using System;
using Be.Timvw.Framework.Domain.Ranges;

namespace Be.Timvw.Framework.Domain.Effectivity
{
    /// <summary>
    /// Represents an element that is effective in a period.
    /// </summary>
    public interface IEffectivity<T>
    {
        /// <summary>
        /// Gets the element.
        /// </summary>
        /// <value>The element.</value>
        T Element { get; }

        /// <summary>
        /// Gets the period.
        /// </summary>
        /// <value>The period.</value>
        IRange<DateTime> Period { get; }

        /// <summary>
        /// Determines whether the element is effective on the given date.
        /// </summary>
        /// <param name="validityDate">The validity date.</param>
        /// <returns>
        /// 	<c>true</c> if [is effective on] [the specified validity date]; otherwise, <c>false</c>.
        /// </returns>
        bool IsEffectiveOn(DateTime validityDate);
    }
}